package com.hs.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hs.system.entity.UserRole;
import com.hs.system.mapper.UserRoleMapper;
import com.hs.system.service.UserRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 菜单 业务层处理
 */
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {

    @Resource
    private UserRoleMapper userRoleMapper;


    @Override
    public int insertOne(long userId,long roleId) {
        UserRole userRole = UserRole.builder().userId(userId).roleId(roleId).build();
        return userRoleMapper.insert(userRole);
    }
}
